package com.share.wechat.fristpage.service.impl;

import com.share.wechat.fristpage.entity.Test;
import com.share.wechat.fristpage.repository.inter.TestRepository;
import com.share.wechat.fristpage.service.TestService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * 实现类
 * Created by er on 2017/9/28.
 */
@Service
public class TestServiceImpl implements TestService {
    @Autowired
    private TestRepository testRepository;

    @Override
    public List<Test> getTests() {
        //List<Test> lists = new ArrayList<>();
        /*lists.add(new Test("1111",1));
        lists.add(new Test("2222",2));
        lists.add(new Test("3333",3));
        lists.add(new Test("4444",4));
        lists.add(new Test("5555",5));
        lists.add(new Test("6666",6));
        lists.add(new Test("7777",7));
        lists.add(new Test("8888",8));
        lists.add(new Test("9999",9));*/
        List<Test> lists = (List<Test>) testRepository.findAll();

        return lists;
    }
}
